class Human(object):
    def __init__(self, name):
        self.name = name
    def work(self):
        print(self.name + "正在工作!")

class Programmer(Human):
    def work(self):
        print(self.name + "正在写代码!")

class Designer(Human):
    def work(self):
        print(self.name + "正在设计!")
# 调用相同的父类方法,产生不同的执行结果
print("---------多态-----------")
p = Programmer("小王")
d = Designer("小木")
p.work()
d.work()
